<template>
	<div>
		<el-row class="bg2 bg4">
			<el-col :span="24">
				<h3 class="baseHeader baseTxt">
					测试转换钥匙状态
					<el-switch class="baseS" v-model="ceshiValue" active-color="rgba(0, 82, 217, 1)"
						inactive-color="rgba(0, 0, 0, 0.26)" disabled>
					</el-switch>
				</h3>
			</el-col>
		</el-row>
		<el-row class="bg1" style="height: auto">
			<el-col :span="24">
				<h3 class="baseHeader text-lf">开关门测试</h3>
				<div class="baseInfo" style="height: auto; align-items: flex-start">
					<el-form :inline="true" :rules="dataRule" ref="dataForm" :model="dataForm">
						<el-form-item label="站台侧" prop="slide">
							<el-select v-model="dataForm.slide" filterable clearable placeholder="请选择站台侧"
								@change="changeStation">
								<el-option v-for="item in stationOptions" :key="item.value" :label="item.label"
									:value="item.value"></el-option>
							</el-select>
						</el-form-item>
						<el-form-item label="PEDC" prop="pedc">
							<el-select v-model="dataForm.pedc" filterable clearable placeholder="请选择pedc"
								@change="changeStation">
								<el-option v-for="item in pedcOptions" :key="item.value" :label="item.label"
									:value="item.value"></el-option>
							</el-select>
						</el-form-item>
						<el-button class="btn1" :disabled="!ceshiValue" type="danger" @click="closeDoor(0)">关门
						</el-button>
						<el-button class="btn1" :disabled="!ceshiValue" type="success" @click="closeDoor(1)">开4A门
						</el-button>
						<el-button class="btn1" :disabled="!ceshiValue" type="success" @click="closeDoor(2)">开8A门
						</el-button>
					</el-form>
				</div>
			</el-col>
		</el-row>
		<el-row class="bg1">
			<el-col :span="24">
				<h3 class="baseHeader text-lf">DCU参数</h3>
				<!-- 搜索条件 -->
				<el-row>
					<el-form :inline="true" ref="doorForm" :model="doorForm" style="display: flex; padding: 0 4.1vw">
						<el-form-item prop="dcu" class="doorNuTxt" label="门控单元编号："
							style="margin-right: 2.6vw; margin-bottom: 0">
							<el-select v-model="doorForm.dcu" filterable multiple collapse-tags clearable placeholder="请选择"
								style="width: 12vw; height: 3.5vh" @change="doorChange">
								<el-checkbox v-model="checkOptions.checkAll" :style="{ padding: '5px 20px' }"
									:indeterminate="checkOptions.isIndeterminate" @change="handleCheckAllChange">
									全选
								</el-checkbox>
								<el-option v-for="(item, index) in options" :key="index" :label="item.dcu"
									:value="item.dcu"></el-option>
							</el-select>
						</el-form-item>
						<div class="baseInfoBtn" style="display: flex; justify-content: end">
							<el-button class="btn1" type="primary" @click="getDCUData()">读取</el-button>
							<el-button class="btn7" type="primary" @click="writeDCUNew()">写入</el-button>
							<el-button class="btn7" type="primary" @click="historyLoad()">加载</el-button>
							<el-button class="btn6" type="primary" @click="save()">保存</el-button>
							<el-button class="btn4" type="primary" @click="exportHandle()">导出所有数据</el-button>
						</div>
					</el-form>
				</el-row>
				<div class="baseInfo">
					<div class="baseInfoContent">
						<el-form :inline="true" :model="baseForm">
							<el-row>
								<div class="baseInfo1 doorNu1">
									<el-form-item label="左门机阻力：">
										<el-input v-model="baseForm.leftNowel" oninput="value=value.replace(/[^\d]/g,'')"
											:readonly="DCUStatus" placeholder="" clearable
											style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input>
									</el-form-item>
									<span class="company">N</span>
								</div>
								<div class="baseInfo1 doorNu1">
									<el-form-item label="右门机阻力：">
										<el-input v-model="baseForm.rightNowel" oninput="value=value.replace(/[^\d]/g,'')"
											:readonly="DCUStatus" placeholder="" clearable
											style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input>
									</el-form-item>
									<span class="company">N</span>
								</div>
							</el-row>
							<el-row>
								<div class="baseInfo1 doorNu1">
									<el-form-item label="关门到位撞击力：">
										<el-input v-model="baseForm.closeImpact" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable
											style="width: 7.8vw; height: 3.5vh"></el-input>
									</el-form-item>
									<el-form-item label="" v-if="type == 2">
										<el-input v-model="baseForm.closeImpactRight" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable
											style="width: 7.8vw; height: 3.5vh"></el-input>
									</el-form-item>
									<span class="company">N</span>
								</div>
								<div class="baseInfo1 doorNu1">
									<el-form-item label="开门到位撞击力：">
										<el-input v-model="baseForm.openImpact" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable
											style="width: 7.8vw; height: 3.5vh"></el-input>
									</el-form-item>
									<el-form-item label="" v-if="type == 2">
										<el-input v-model="baseForm.openImpactRight" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable
											style="width: 7.8vw; height: 3.5vh"></el-input>
									</el-form-item>
									<span class="company">N</span>
								</div>
							</el-row>
							<el-row>
								<div class="baseInfo1">
									<el-form-item label="遇障力：">
										<el-input v-model="baseForm.encounterNowel" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable
											style="width: 7.8vw; height: 3.5vh"></el-input>
									</el-form-item>
									<el-form-item label="" v-if="type == 2">
										<el-input v-model="baseForm.encounterNowelRight" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable
											style="width: 7.8vw; height: 3.5vh"></el-input>
									</el-form-item>
									<span class="company">N</span>
								</div>
								<div class="baseInfo1">
									<el-form-item label="遇障回退距离：">
										<el-input v-model="baseForm.encounterRegressionDistance" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable
											style="width: 7.8vw; height: 3.5vh"></el-input>
									</el-form-item>
									<el-form-item label="" v-if="type == 2">
										<el-input v-model="baseForm.encounterRegressionDistanceRight" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable
											style="width: 7.8vw; height: 3.5vh"></el-input>
									</el-form-item>
									<span class="company">mm</span>
								</div>
							</el-row>
							<el-row>
								<div class="baseInfo1">
									<el-form-item label="关门遇障次数：">
										<el-input v-model="baseForm.closeEncounterNum" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable
											style="width: 7.8vw; height: 3.5vh"></el-input>
									</el-form-item>
									<el-form-item label="" v-if="type == 2">
										<el-input v-model="baseForm.closeEncounterNumRight" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable
											style="width: 7.8vw; height: 3.5vh"></el-input>
									</el-form-item>
									<span class="company">次</span>
								</div>
								<div class="baseInfo1">
									<el-form-item label="开门遇障次数：">
										<el-input v-model="baseForm.openEncounterNum" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable
											style="width: 7.8vw; height: 3.5vh"></el-input>
									</el-form-item>
									<el-form-item label="" v-if="type == 2">
										<el-input v-model="baseForm.openEncounterNumRight" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable
											style="width: 7.8vw; height: 3.5vh"></el-input>
									</el-form-item>
									<span class="company">次</span>
								</div>
							</el-row>
							<el-row>
								<div class="baseInfo1 doorNu1">
									<el-form-item label="关门遇障等待时间：">
										<el-input v-model="baseForm.closeEncounterTime" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable
											style="width: 7.8vw; height: 3.5vh"></el-input>
									</el-form-item>
									<el-form-item label="" v-if="type == 2">
										<el-input v-model="baseForm.closeEncounterTimeRight" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable
											style="width: 7.8vw; height: 3.5vh"></el-input>
									</el-form-item>
									<span class="company">s</span>
								</div>
								<div class="baseInfo1 doorNu1">
									<el-form-item label="开门遇障等待时间：">
										<el-input v-model="baseForm.openEncounterTime" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable
											style="width: 7.8vw; height: 3.5vh"></el-input>
									</el-form-item>
									<el-form-item label="" v-if="type == 2">
										<el-input v-model="baseForm.openEncounterTimeRight" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable
											style="width: 7.8vw; height: 3.5vh"></el-input>
									</el-form-item>
									<span class="company">s</span>
								</div>
							</el-row>
							<el-row>
								<div class="baseInfo1 doorNu1">
									<el-form-item label="蜂鸣器音量：">
										<el-input v-model="baseForm.buzzerGearSetting" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" placeholder="" clearable
											style="width: 7.8vw; height: 3.5vh; min-height: 30px"></el-input>
									</el-form-item>
									<span class="company">档位</span>
								</div>
								<div class="baseInfo1 doorNu1">
									<el-form-item label="手解重关时间：">
										<el-input v-model="baseForm.macloseTime" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable
											style="width: 7.8vw; height: 3.5vh"></el-input>
									</el-form-item>
									<el-form-item label="" v-if="type == 2">
										<el-input v-model="baseForm.macloseTimeRigth" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable
											style="width: 7.8vw; height: 3.5vh"></el-input>
									</el-form-item>
									<span class="company">s</span>
								</div>
							</el-row>
							<el-row> </el-row>
							<el-row>
								<div class="baseInfo1 doorNu1">
									<el-form-item label="过流保护阈值：">
										<el-input v-model="baseForm.overProThre" type="number" step="0.1"
											:readonly="DCUStatus" clearable style="width: 7.8vw; height: 3.5vh">
										</el-input>
									</el-form-item>
									<el-form-item label="" v-if="type == 2">
										<el-input v-model="baseForm.overProThreRight" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable
											style="width: 7.8vw; height: 3.5vh"></el-input>
									</el-form-item>
									<span class="company">A</span>
								</div>
								<div class="baseInfo1">
									<el-form-item label="端门报警时间：">
										<el-input class="input-width" v-model="baseForm.endAlarmTime" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable></el-input>
									</el-form-item>
									<el-form-item label="" v-if="type == 2">
										<el-input class="input-width" v-model="baseForm.endAlarmTimeRight"
											:readonly="DCUStatus" oninput="value=value.replace(/[^\d]/g,'')"
											clearable></el-input>
									</el-form-item>
									<span class="company">s</span>
								</div>
							</el-row>
							<el-row>
								<div class="baseInfo1 doorNu1">
									<el-form-item label="电磁锁档位：">
										<el-input class="input-width" v-model="baseForm.elockGearSetting"
											:readonly="DCUStatus" oninput="value=value.replace(/[^\d]/g,'')"
											clearable></el-input>
									</el-form-item>
									<el-form-item label="" v-if="type == 2">
										<el-input class="input-width" v-model="baseForm.elockGearSettingRight"
											:readonly="DCUStatus" oninput="value=value.replace(/[^\d]/g,'')"
											clearable></el-input>
									</el-form-item>
									<span class="company">档位</span>
								</div>
								<div class="baseInfo1">
									<el-form-item label="是否有应急门：">
										<span v-if="baseForm.isHaveEmergencyDoor == 1">是</span>
										<span v-else>否</span>
									</el-form-item>
									<el-form-item label="" v-if="type == 2">
										<el-input class="input-width" v-model="baseForm.isHaveEmergencyDoor"
											:readonly="DCUStatus" oninput="value=value.replace(/[^\d]/g,'')"
											clearable></el-input>
									</el-form-item>
								</div>
								<!-- <div class="baseInfo1">
									<el-form-item label="死区时间：">
										<el-input class="input-width" v-model="baseForm.deadZone" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable></el-input>
									</el-form-item>
									<el-form-item label="" v-if="type == 2">
										<el-input class="input-width" v-model="baseForm.deadZoneRight" :readonly="DCUStatus"
											oninput="value=value.replace(/[^\d]/g,'')" clearable></el-input>
									</el-form-item>
									<span class="company">us</span>
								</div> -->
							</el-row>
						</el-form>
					</div>
				</div>
			</el-col>
		</el-row>
		<el-row class="bg1">
			<el-col :span="24">
				<h3 class="baseHeader text-lf">DCU信息</h3>
				<div class="baseInfo">
					<el-form :inline="true" ref="dateForm" :model="dateForm" style="display: flex; width: 100%">
						<el-form-item label="门控单元编号：">
							<el-select v-model="dateForm.DCU" filterable collapse-tags clearable placeholder="请选择DCU编号"
								@change="changeDCU()">
								<el-option v-for="(item, index) in options" :key="item.dcu" :label="item.dcu"
									:value="item.dcu"></el-option>
							</el-select>
						</el-form-item>
						<el-button class="btn1" type="primary" @click="getDateData()">读取</el-button>
						<div class="baseInfo1">
							<!-- <el-form-item label="生产日期：">
                <span>{{ dateForm.date ? dateForm.date : "0000-00-00" }}</span>
              </el-form-item> -->
							<el-form-item label="软件版本号：">
								<span>{{ version ? version : "无" }}</span>
							</el-form-item>
						</div>
					</el-form>
				</div>
			</el-col>
		</el-row>
		<div style="display: flex;">
			<el-row class="bg1 width-50 mar-right-10">
				<el-col :span="24" class="mar-right-10">
					<h3 class="baseHeader text-lf">自学习</h3>
					<div class="baseInfo">
						<el-form :inline="true" ref="dateForm1" :model="dateForm1" style="display: flex; width: 100%">
							<el-form-item label="门控单元编号：">
								<el-select v-model="dateForm1.DCU" filterable multiple collapse-tags clearable
									placeholder="请选择DCU编号" @change="changeDCU1()">
									<el-checkbox v-model="checkOptions1.checkAll" :style="{ padding: '5px 20px' }"
										:indeterminate="checkOptions1.isIndeterminate" @change="handleCheckAllChange1">
										全选
									</el-checkbox>
									<el-option v-for="(item, index) in options" :key="item.dcu" :label="item.dcu"
										:value="item.dcu"></el-option>
								</el-select>
							</el-form-item>
							<el-button class="btn1" type="primary" @click="getSelfLearning()">自学习</el-button>
						</el-form>
					</div>
				</el-col>

			</el-row>
			<el-row class="bg1 width-50">
				<el-col :span="24">
					<h3 class="baseHeader text-lf">设置应急门采集配置</h3>
					<div class="baseInfo">
						<el-form :inline="true" ref="dateForm2" :model="dateForm2" style="display: flex; width: 100%">
							<el-form-item label="应急门采集配置：">
								<!-- <el-select v-model="dateForm2.DCU" filterable multiple collapse-tags clearable
									placeholder="请选择DCU编号" @change="changeDCU2()">
									<el-checkbox v-model="checkOptions2.checkAll" :style="{ padding: '5px 20px' }"
										:indeterminate="checkOptions2.isIndeterminate" @change="handleCheckAllChange2">
										全选
									</el-checkbox>
									<el-option v-for="(item, index) in yjoptions" :key="item.dcu" :label="item.dcu"
										:value="item.dcu"></el-option>
								</el-select> -->
							</el-form-item>
							<el-button class="btn1" type="primary" @click="yjSetting()">应急门采集配置</el-button>
						</el-form>
					</div>
				</el-col>
			</el-row>
		</div>

		<el-row class="bg2 bg3">
			<el-col :span="24">
				<div class="dcu-table">
					<h3 class="baseHeader text-lf">DCU固件文件</h3>
					<div>
						<el-button class="newAdd" v-if="$hasPermission('sys:user:save')" type="primary"
							@click="addOrUpdateHandle()">新增</el-button>
					</div>
				</div>
				<div>
					<el-table v-loading="dataListLoading" :data="dataList" border
						@selection-change="dataListSelectionChangeHandle" @sort-change="dataListSortChangeHandle"
						style="width: 100%">
						<el-table-column type="selection" header-align="center" align="center" width="50">
						</el-table-column>
						<el-table-column type="index" label="序号" header-align="center" align="center" width="50">
						</el-table-column>
						<el-table-column prop="name" label="DCU固件名称" header-align="center" align="center">
						</el-table-column>
						<el-table-column prop="packagePath" label="DCU固件路径" header-align="center" align="center">
						</el-table-column>
						<el-table-column prop="createDate" label="登记日期" header-align="center" align="center"
							width="180"></el-table-column>
						<el-table-column prop="sysUserName" label="登记人" header-align="center" align="center">
						</el-table-column>
						<el-table-column prop="doorList" label="失败门编号" header-align="center" align="center">
							<template slot-scope="scope">
								{{ scope.row.doorList }}
								<!-- <div class="progress-bar">
									<div class="progress-bg" :style="{ width: jdNumber }"></div>
								</div> -->
							</template>
						</el-table-column>
						<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center"
							width="300">
							<template slot-scope="scope">
								<el-button type="primary" round size="mini"
									@click="upgrade(scope.row.packagePath, scope.row.id, false)">
									升级DCU</el-button>
								<el-button type="danger" round size="mini" @click="deleteHandleDCU(scope.row.id)">
									{{ $t("delete") }}
								</el-button>
							</template>
						</el-table-column>
					</el-table>
					<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDCUpackageList">
					</add-or-update>
					<dcuUpgrade v-if="dcuUpgtadeVisible" ref="dcuUpgrade" @clearData="clearData" :jdNumber="jdNumber">
					</dcuUpgrade>
				</div>
			</el-col>
		</el-row>
		<oper-data v-if="operdataVisible" ref="operdataFrom" @refreshDataList="init"></oper-data>
		<history-or-update v-if="historyVisible" ref="historyForm" @refreshDataList="init" @getHistory="getHistory">
		</history-or-update>
		<el-dialog :visible.sync="saveVisible" title="DCU数据保存" :close-on-click-modal="false" :close-on-press-escape="false">
			<el-form :model="saveForm" ref="saveForm" :rules="saveRule" @keyup.enter.native="confirm()" label-width="200px">
				<el-form-item prop="name" label="DCU数据保存名称">
					<el-input v-model="saveForm.name" placeholder="DCU数据保存名称"></el-input>
				</el-form-item>
			</el-form>
			<template slot="footer">
				<el-button @click="saveVisible = false">{{ $t("cancel") }}</el-button>
				<el-button type="primary" @click="confirm()">{{
					$t("confirm")
				}}</el-button>
			</template>
		</el-dialog>
	</div>
</template>

<script>
import debounce from "lodash/debounce";
import mixinViewModule from "@/mixins/view-module";
import AddOrUpdate from "./sysParam-add-or-update";
import dcuUpgrade from "./dcuUpgrade.vue";
import utils from "@/utils/utils";
import Cookies from "js-cookie";
import operData from "../oper/oper-data.vue";
import historyOrUpdate from "../oper/oper-add-or-update.vue";
import qs from 'qs'
export default {
	mixins: [mixinViewModule],
	components: {
		AddOrUpdate,
		dcuUpgrade,
		operData,
		historyOrUpdate,
	},
	data() {
		return {
			mixinViewModuleOptions: {
				createdIsNeed: false,
				deleteURL: "",
				deleteIsBatch: true,
				exportURL: "/psc/dcuparameters/export",
			},
			dataForm: {
				// DCU:'',
				slide: "",
				pedc: "",
				ops: "",
				// openClose:'',
				// dtype:'DCU',
				// isDel:0,
			},
			DCUoptions: [], //DCU的options
			stationOptions: [{
				value: 0,
				label: "上行",
			},
			{
				value: 1,
				label: "下行",
			},
			{
				value: 2,
				label: "上下行",
			},
			], //上下行
			pedcOptions: [{
				value: 0,
				label: "pedca",
			},
			{
				value: 1,
				label: "pedcb",
			},
			],
			openCloseOptions: utils.openCloseOptions, //开关门
			baseForm: {
				leftNowel: "", //门机阻力
				rightNowel: "", //门机阻力
				closeImpact: "", //关门到位撞击力
				// closeImpactRight: '', //关门到位撞击力
				openImpact: "", //开门到位撞击力
				// openImpactRight: '', //开门到位撞击力
				encounterNowel: "", //遇障力
				// encounterNowelRight: '', //遇障力
				encounterRegressionDistance: "", //遇障回退距离
				// encounterRegressionDistanceRight: '', //遇障回退距离
				closeEncounterNum: "", //关门遇障次数
				// closeEncounterNumRight: '', //关门遇障次数
				openEncounterNum: "", //开门遇障次数
				// openEncounterNumRight: '', //开门遇障次数
				closeEncounterTime: "", //关门遇障等待时间
				// closeEncounterTimeRight: '', //关门遇障等待时间
				openEncounterTime: "", //开门遇障等待时间
				// openEncounterTimeRight: '', //开门遇障等待时间
				buzzerGearSetting: "", //蜂鸣器音量
				macloseTime: "", //手解重关时间
				// macloseTimeRigth: '', //手解重关时间
				overProThre: "", //过流保护阈值
				// overProThreRight: '', //过流保护阈值
				endAlarmTime: "", //端门报警时间
				// endAlarmTimeRight: '', //端门报警时间
				elockGearSetting: "", //电磁锁档位
				// elockGearSettingRight:'',//电磁锁档位
				deadZone: "", //死区时间
				isHaveEmergencyDoor: "",
				// deadZoneRight:'',//死区时间
			},
			stationSide: "", //上下行
			options: [],
			yjoptions: [], //应急门的数组
			ceshiValue: false,
			type: Cookies.get("type"), //Cookies.get('type')
			DCUStatus: false,
			PEDCStatus: true,
			doorIndex: "", //门的编号,
			operdataVisible: false,
			dcuUpgtadeVisible: false,
			jdNumber: "", //进度条的数据显示
			checkOptions: {
				isIndeterminate: false,
				checkAll: false,
			},
			checkOptions1: {
				isIndeterminate: false,
				checkAll: false,
			},
			checkOptions2: {
				isIndeterminate: false,
				checkAll: false,
			},
			historyVisible: false,
			doorForm: {
				dcu: "",
			},
			dateForm: {
				DCU: "",
				date: "",
			},
			dateForm1: {
				DCU: "",
			},
			dateForm2: {
				DCU: "",
			},
			version: "", //版本号
			saveVisible: false,
			saveForm: {
				name: "",
			},
			updateId: "", //升级的全局ID
			Arr: [],
			readDataStatus: false,
		};
	},
	activated() {
		this.init();
	},
	mounted() {
		window.addEventListener('onmessageWSDCU', this.getSocketDataDCU);
		window.addEventListener('onmessageWSPSC', this.getSocketDataPSC);
	},
	destroyed() {
		window.removeEventListener('onmessageWSDCU', this.getSocketDataDCU);
		window.removeEventListener('onmessageWSPSC', this.getSocketDataPSC);
	},
	computed: {
		dataRule() {
			return {
				slide: [{
					required: true,
					message: "站台侧不为空",
					trigger: "blur"
				}],
				pedc: [{
					required: true,
					message: "pedc不为空",
					trigger: "blur",
				},],
			};
		},
		saveRule() {
			return {
				name: [{
					required: true,
					message: "DCU数据保存名称不能为空",
					trigger: "blur",
				},],
			};
		},
	},
	watch: {
		"baseForm.buzzerGearSetting": {
			handler(val) {
				if (val > 3 && this.readDataStatus) {
					this.baseForm.buzzerGearSetting = "";
					return this.$message.error("蜂鸣器音量不能大于三档");
				}
			},
			deep: true,
			immediate: true,
		},
		"baseForm.elockGearSetting": {
			handler(val) {
				if (val > 3 && this.readDataStatus) {
					this.baseForm.elockGearSetting = "";
					return this.$message.error("电磁锁档位上不能大于三档");
				}
			},
			deep: true,
			immediate: true,
		},
	},
	methods: {
		getSocketDataDCU(res) {
			if (res.detail.data) {
				this.handleMsg();
			}
		},

		getSocketDataPSC(res) {
			if (res.detail.data) {
				this.handleMsgPSC();
			}
		},
		init() {
			setTimeout(() => {
				this.handleMsgPSC() //获取心跳
			}, 200)
			//获取门的信息
			var p0 = new Promise((resolve, reject) => {
				this.getdoorList(() => {
					resolve();
				});
			});
			var p1 = new Promise((resolve, reject) => {
				this.getDCUpackageList(() => {
					resolve();
				});
			});
			Promise.all([p0, p1]).then(() => {
				this.handleMsg();
				this.handleMsgPSC();
				// this.getDCUData()
				// this.initEcharts()
			});
		},
		//门的编号
		getdoorList(callback) {
			this.DCUoptions = [];
			this.yjoptions = [];
			this.$http
				.get("/psc/door/getDoor")
				.then((res) => {
					if (this.dataForm.stationSide == 1) {
						res.data.data.up.forEach((item) => {
							if (item.doorType == 1) {
								this.DCUoptions.push(item);
							}
						});
					} else if (this.dataForm.stationSide == 0) {
						res.data.data.down.forEach((item) => {
							if (item.doorType == 1) {
								this.DCUoptions.push(item);
							}
						});
					}
					this.options = res.data.data.up.concat(res.data.data.down);
					for (var i = 0; i < this.options.length; i++) {
						if (this.options[i].doorType === 2) {
							this.yjoptions.push(this.options[i])
						}
						if (
							this.options[i].doorType === 0 ||
							this.options[i].doorType === 2
						) {
							this.options.splice(i, 1); // 将使后面的元素依次前移，数组长度减1
							i--; // 如果不减，将漏掉一个元素
						}
					}
					// this.baseForm.dcu = this.options[0].dcu
					this.stationSide = this.options[0].type;
					if (callback) {
						callback();
					}
				})
				.then(() => {
					// this.getDCUData()
				});
		},
		// 流向全选
		handleCheckAllChange(e) {
			this.doorForm.dcu = e ? this.options.map((item) => item.dcu) : [];
			this.checkOptions.isIndeterminate = false;
		},
		// 流向全选
		handleCheckAllChange1(e) {
			this.dateForm1.DCU = e ? this.options.map((item) => item.dcu) : [];
			this.checkOptions1.isIndeterminate = false;
		},
		handleCheckAllChange2(e) {
			this.dateForm2.DCU = e ? this.yjoptions.map((item) => item.dcu) : [];
			this.checkOptions2.isIndeterminate = false;
		},
		//改变门的编号
		doorChange() {
			const nowLength = this.doorForm.dcu.length;
			this.checkOptions.isIndeterminate =
				nowLength > 0 && nowLength < this.options.length;
			this.checkOptions.checkAll = nowLength == this.options.length;
			this.$forceUpdate();
		},
		//升级DCU
		upgrade(path, id, status) {
			this.Arr = []
			this.dcuUpgtadeVisible = true;
			this.updateId = id;
			this.$nextTick(() => {
				this.$refs.dcuUpgrade.init(path, status);
			});
		},
		//改变DCU获取index的值
		changeDCU() {
			// this.DCUoptions.forEach((val, index) => {
			// 	if (this.dataForm.DCU == val.dcu) {
			// 		this.doorIndex = index + 1;
			// 	}
			// });
		},
		//改变自学习状态
		changeDCU1() {
			const nowLength = this.dateForm1.DCU.length;
			this.checkOptions1.isIndeterminate =
				nowLength > 0 && nowLength < this.options.length;
			this.checkOptions1.checkAll = nowLength == this.options.length;
			this.$forceUpdate();
		},
		changeDCU2() {
			const nowLength = this.dateForm2.DCU.length;
			this.checkOptions2.isIndeterminate =
				nowLength > 0 && nowLength < this.yjoptions.length;
			this.checkOptions2.checkAll = nowLength == this.yjoptions.length;
			this.$forceUpdate();
		},
		//自学习
		getSelfLearning() {
			var dcuId = [];
			this.dateForm1.DCU.forEach(item => {
				if (item > 200) {
					dcuId.push(item - 200);
				}
				if (item > 100 && item < 200) {
					dcuId.push(Number(item) + 28);
				}
			})
			this.$http.get(`/psc/dcu/autLearn`, {
				params: {
					"dcuArr": dcuId
				},
				paramsSerializer: params => {
					return qs.stringify(params, { indices: false })
				}
			}).then((res) => {
				if (res.data.code !== 0) {
					return this.$message.error(res.data.msg);
				}
				this.$message({
					message: this.$t('prompt.success'),
					type: 'success',
					duration: 500,
					onClose: () => {

					}
				})
			});
		},
		//应急门的配置
		yjSetting() {
			this.$http.get(`/psc/dcu/emergencyDoorConfig`).then((res) => {
				if (res.data.code !== 0) {
					return this.$message.error(res.data.msg);
				}
				this.$message({
					message: this.$t('prompt.success'),
					type: 'success',
					duration: 500,
					onClose: () => {

					}
				})
			});
		},
		//关门
		closeDoor(id) {
			this.$refs["dataForm"].validate((valid) => {
				if (!valid) {
					return false;
				}
				var obj = {
					...this.dataForm,
					ops: id,
				};
				this.$http.post("/psc/cmd/openCloseDoor", obj).then((res) => {
					if (res.data.code !== 0) {
						return this.$message.error(res.data.msg);
					}
					this.$message({
						message: this.$t("prompt.success"),
						type: "success",
						duration: 500,
						onClose: () => { },
					});
				});
			});
		},
		//改变站台测的上下行
		changeStation() {
			this.getdoorList();
		},
		//写入DCU
		writeDCUNew: debounce(
			function () {
				if (this.doorForm.dcu.length !== 0) {
					this.readDataStatus = true
					if (this.baseForm.buzzerGearSetting > 3 || this.baseForm.elockGearSetting > 3) {
						this.baseForm.buzzerGearSetting = "";
						this.baseForm.elockGearSetting = "";
						return this.$message.error("蜂鸣器音量和电磁锁档位不能大于三档");
						return false
					}
					var obj = this.paramObj();
					this.$http.post("/psc/dcu/writeDcuParams", obj).then((res) => {
						if (res.data.code !== 0) {
							return this.$message.error(res.msg);
						}
						this.$message({
							message: this.$t("prompt.success"),
							type: "success",
							duration: 500,
							onClose: () => {
								this.visible = false;
							},
						});
					});
				} else {
					return this.$message.error("请选择门控单元编号");
				}
			},
			500, {
			leading: true,
			trailing: false,
		}
		),
		//加载
		historyLoad() {
			if (this.doorForm.dcu.length > 1) {
				this.$message({
					message: "门控制单元编号只能选一个",
					type: "error",
					duration: 2000,
				});
			} else {
				this.historyVisible = true;
				this.$nextTick(() => {
					this.$refs.historyForm.init();
				});
			}
		},
		//获取历史保存的数据
		getHistory(id) {
			this.$http.get(`/psc/dcuparameters/${id}`).then((res) => {
				if (res.data.code == 0 && res.data.data !== null) {
					this.$nextTick(() => {
						this.getData(res.data.data);
					});
				}
			});
		},
		// 保存数据
		save() {
			if (this.doorForm.dcu.length !== 0) {
				this.saveVisible = true;
				this.$nextTick(() => {
					this.$refs["saveForm"].resetFields();
				});
			} else {
				return this.$message.error("请选择门控单元编号");
			}
		},
		//保存数据确定
		confirm() {
			this.$refs["saveForm"].validate((valid) => {
				if (!valid) {
					return false;
				}
				var obj = this.paramObj();
				obj = {
					name: this.saveForm.name,
					...obj,
				};
				this.$http.post("/psc/dcuparameters", obj).then((res) => {
					if (res.data.code !== 0) {
						return this.$message.error(res.msg);
					}
					this.$message({
						message: this.$t("prompt.success"),
						type: "success",
						duration: 500,
						onClose: () => {
							this.saveVisible = false;
						},
					});
				});
			});
		},
		//存储数据专用
		paramObj() {
			var obj = {
				dcuArr: this.returnDoorId(),
				...this.baseForm,
			};
			return obj;
		},
		//返回相对应的门的ID
		returnDoorId() {
			var doorNum = [];
			for (var i = 0; i < this.doorForm.dcu.length; i++) {
				if (Number(this.doorForm.dcu[i]) > 200) {
					let num1 = Number(this.doorForm.dcu[i]) - 200;
					doorNum.push(num1);
				} else if (
					Number(this.doorForm.dcu[i]) > 100 &&
					Number(this.doorForm.dcu[i]) < 200
				) {
					let num1 = Number(this.doorForm.dcu[i]) + 28;
					doorNum.push(num1);
				}
			}
			return doorNum;
		},
		//读取DCU编号
		getDCUData: debounce(
			function () {
				this.readDataStatus = false
				if (this.doorForm.dcu.length > 1) {
					return this.$message.error("门控制单元编号只能选一个");
				} else if (this.doorForm.dcu.length == 0) {
					return this.$message.error("请选择门控单元编号");
				} else {
					this.getDCUCS();
				}
			},
			500, {
			leading: true,
			trailing: false,
		}
		),
		//获取DCU初始值
		getDCUCS() {
			this.$http
				.get("/psc/dcu/readCurrentDcu/" + this.returnDoorId()[0])
				.then((res) => {
					if (res.data.code == 0 && res.data.data !== null) {
						this.getData(res.data.data);
						// this.getData(res.data.data.dcuParametersDTO, res.data.data.sysDcuState)
						// // 版本号
						// this.baseForm.version = res.data.data.sysDcuState.version
					}
				});
		},
		//读取生产日期
		getDateData() {
			// if (!this.dateForm.DCU) {
			// 	this.$message({
			// 		message: "门控制单元编号不能为空",
			// 		type: "error",
			// 		duration: 2000,
			// 	});
			// } else {
			var dcuId = "";
			if (this.dateForm.DCU > 200) {
				dcuId = this.dateForm.DCU - 200;
			}
			if (this.dateForm.DCU > 100 && this.dateForm.DCU < 200) {
				dcuId = Number(this.dateForm.DCU) + 28;
			}
			// this.getdoorDate(dcuId);
			// setTimeout(() => {
			this.getdoorVersion(dcuId);
			// }, 100);
			// }
		},
		// 获取生产日期
		getdoorDate(dcuId) {
			this.$http.get(`/psc/dcu/readYmd/` + dcuId).then((res) => {
				if (res.data.code !== 0) {
					return this.$message.error(res.data.msg);
				}
				this.dateForm.date = res.data.data;
				// this.$message({
				// 	message: this.$t('prompt.success'),
				// 	type: 'success',
				//     duration: 500,
				// 	onClose: () => {

				// 	}
				// })
			});
		},
		//获取版本号
		getdoorVersion(dcuId) {
			this.$http.get(`/psc/dcu/readVersion/` + dcuId).then((res) => {
				if (res.data.code !== 0) {
					return this.$message.error(res.data.msg);
				}
				this.version = res.data.data;
				// this.$message({
				// 	message: this.$t('prompt.success'),
				// 	type: 'success',
				//     duration: 500,
				// 	onClose: () => {

				// 	}
				// })
			});
		},
		//删除DCU的升级包
		deleteHandleDCU(id) {
			this.$confirm(
				this.$t("prompt.info", {
					handle: this.$t("delete"),
				}),
				this.$t("prompt.title"), {
				confirmButtonText: this.$t("confirm"),
				cancelButtonText: this.$t("cancel"),
				type: "warning",
			}
			).then(() => {
				var obj = {
					id: id,
					isDel: 1,
				};
				this.$http.put(`/psc/packagemanage`, obj).then((res) => {
					if (res.data.code !== 0) {
						return this.$message.error(res.msg);
					}
					this.$message({
						message: this.$t("prompt.success"),
						type: "success",
						duration: 500,
						onClose: () => {
							this.getDCUpackageList();
						},
					});
				});
			});
		},
		//获取dcu升级包
		getDCUpackageList(callback) {
			this.dataListLoading = true;
			this.$http
				.get("/psc/packagemanage/page", {
					params: {
						DCU: this.dataForm.DCU,
						stationSide: this.dataForm.stationSide,
						openClose: "",
						dtype: "DCU",
						isDel: 0,
					},
				})
				.then(({
					data: res
				}) => {
					this.dataListLoading = false;
					if (res.code !== 0) {
						this.dataList = [];
						this.total = 0;
						return this.$message.error(res.msg);
					}
					this.dataList = res.data.list;
					this.total = res.data.total;
					this.dataList.forEach((item, index) => {
						this.$set(this.dataList[index], "doorList", "");
					});
					callback();
				});
		},
		//获取基础参数
		getData(val, val1) {
			this.baseForm.leftNowel = val.leftNowel;
			this.baseForm.rightNowel = val.rightNowel;
			this.baseForm.closeTime = val.closeTime;
			this.baseForm.openTime = val.openTime;
			this.baseForm.slowCloseTime = val.slowCloseTime;
			this.baseForm.slowOpenTime = val.slowOpenTime;
			this.baseForm.closeImpact = val.closeImpact;
			this.baseForm.openImpact = val.openImpact;
			this.baseForm.encounterNowel = val.encounterNowel;
			this.baseForm.encounterRegressionDistance =
				val.encounterRegressionDistance;
			this.baseForm.closeEncounterNum = val.closeEncounterNum;
			this.baseForm.openEncounterNum = val.openEncounterNum;
			this.baseForm.closeEncounterTime = val.closeEncounterTime;
			this.baseForm.openEncounterTime = val.openEncounterTime;
			this.baseForm.buzzerGearSetting = val.buzzerGearSetting;
			this.baseForm.lockTime = val.lockTime;
			this.baseForm.macloseTime = val.macloseTime;
			this.baseForm.overProThre = val.overProThre;
			this.baseForm.endAlarmTime = val.endAlarmTime;
			this.baseForm.buzzerGearSetting = val.buzzerGearSetting;
			this.baseForm.elockGearSetting = val.elockGearSetting;
			this.baseForm.deadZone = val.deadZone;
			this.baseForm.isHaveEmergencyDoor = val.isHaveEmergencyDoor
			// if (this.type == 1) {
			// 	this.baseForm.rightNowel = val.rightNowel
			// 	this.baseForm.closeTimeRight = val.closeTimeRight
			// 	this.baseForm.openTimeRight = val.openTimeRight
			// 	this.baseForm.slowCloseTimeRight = val.slowCloseTimeRight
			// 	this.baseForm.slowOpenTimeRight = val.slowOpenTimeRight
			// 	// this.baseForm.closeBrakeSpeedRight = val.closeBrakeSpeedRight
			// 	// this.baseForm.openBrakeSpeedRight = val.openBrakeSpeedRight
			// 	this.baseForm.closeImpactRight = val.closeImpactRight
			// 	this.baseForm.openImpactRight = val.openImpactRight
			// 	this.baseForm.encounterNowelRight = val.encounterNowelRight
			// 	this.baseForm.encounterRegressionDistanceRight = val.encounterRegressionDistanceRight
			// 	// this.baseForm.closeAccelerationRight = val.closeAccelerationRight
			// 	// this.baseForm.openAccelerationRight = val.openAccelerationRight
			// 	// this.baseForm.closeUniformSpeedRight = val.closeUniformSpeedRight
			// 	// this.baseForm.openUniformSpeedRight = val.openUniformSpeedRight
			// 	// this.baseForm.closeDeAcRight = val.closeDeAcRight
			// 	// this.baseForm.openDeAcRight = val.openDeAcRight
			// 	this.baseForm.closeEncounterNumRight = val.closeEncounterNumRight
			// 	this.baseForm.openEncounterNumRight = val.openEncounterNumRight
			// 	this.baseForm.closeEncounterTimeRight = val.closeEncounterTimeRight
			// 	this.baseForm.openEncounterTimeRight = val.openEncounterTimeRight
			// 	this.baseForm.buzzerGearSettingRight = val.buzzerGearSettingRight
			// 	this.baseForm.lockTimeRight = val.lockTimeRight
			// 	this.baseForm.macloseTimeRigth = val.macloseTimeRigth
			// 	this.baseForm.overProThreRight = val.overProThreRight
			// 	this.baseForm.endAlarmTimeRight = val.endAlarmTimeRight
			// }
		},
		//单独下发---弃用
		writeDCU() {
			this.operdataVisible = true;
			this.$nextTick(() => {
				var obj = {
					...this.baseForm,
					DCU: this.baseForm.dcu,
				};
				this.$refs.operdataFrom.init(obj, 0);
			});
		},
		// 下发所有----弃用
		writeAllDCU() {
			this.operdataVisible = true;
			var arr = [];
			arr.push(this.baseForm.dcu);
			this.$nextTick(() => {
				var obj = {
					...this.baseForm,
					DCU: arr,
				};
				this.$refs.operdataFrom.init(obj, 2);
			});
		},
		//接收websocket数据
		handleMsgPSC() {
			this.$globalWebSocket.ws.send("psc");
			this.$globalWebSocket.ws.onmessage = this.getMessagePSC
		},
		//获取websocket数据
		getMessagePSC(e) {
			var message = JSON.parse(e.data)
			if (message.taskStatus !== 3) {
				this.ceshiValue = (message.upLink.sysPscCenterControlPanel.testOpAllowed == 1 || message.downLink
					.sysPscCenterControlPanel.testOpAllowed == 1);
			}

		},
		//websocket通讯
		handleMsg() {
			this.$globalWebSocket.ws1.send("DCU");
			this.$globalWebSocket.ws1.onmessage = this.getMessage;
		},
		//获取通讯
		getMessage(e) {
			var message = JSON.parse(e.data);
			var doorId = this.returnId(message.failDcuId);
			if (doorId != undefined) {
				this.Arr.push(doorId);
			}
			let uniqueArray = this.Arr.filter((item, index, array) => {
				return array.indexOf(item) === index;
			});
			this.dataList.forEach((item, index) => {
				if (item.id == this.updateId) {
					this.$set(this.dataList[index], "doorList", uniqueArray); //获取失败的门编号
					// item.doorList.push(doorId)
				}
			});

			if (message.process !== undefined) {
				this.jdNumber = message.process + '%'
			}
			// this.jdNumber = (message.current / message.sum) * 100 + "%";
			//获取基础参数
			// this.getData(message.dcuParametersDTO, message.sysDcuState);
		},
		returnId(id) {
			if (id < 42) {
				id = id + 200;
			} else if (id > 128) {
				id = id - 28;
			}
			return id;
		},
		//每次升级dcu,清空一下失败门编号
		clearData(val) {
			if (val == 1) {
				this.dataList.forEach((item, index) => {
					if (item.id == this.updateId) {
						this.$set(this.dataList[index], "doorList", ''); //获取失败的门编号
						// item.doorList.push(doorId)
					}
				});
			}
		},
		// 开关门测试---弃用
		openClosedoor() {
			var obj = {
				upDownLink: this.dataForm.stationSide,
				doorNo: this.doorIndex,
				openOrClose: this.dataForm.openClose,
			};
			this.$http.post("/psc/cmd/openCloseDoor", obj).then((res) => {
				if (res.data.code !== 0) {
					return this.$message.error(res.msg);
				}
				this.$message({
					message: this.$t("prompt.success"),
					type: "success",
					duration: 500,
					onClose: () => { },
				});
			});
		},
		//读PEDC
		readPEDC() {
			this.PEDCStatus = true;
		},
		//写PEDC
		writePEDC() {
			this.PEDCStatus = false;
		},
	},
};
</script>

<style scoped>
.bg {
	background-color: #fff;
	border-radius: 10px;
	display: flex;
	align-items: center;
	height: 7.6vh;
	line-height: 7.6vh;
	padding: 0 1.8vw;
}

.bg>>>.el-form--inline .el-form-item__content,
.el-form--inline .el-form-item {
	vertical-align: middle !important;
}

.bg>>>.el-form-item {
	margin-bottom: 0;
}

.bg1 {
	background-color: #fff;
	border-radius: 10px;
	display: flex;
	align-items: center;
	/* height: 83.1vh; */
	/* height: 71vh; */
	padding: 2.1vh 1.5vw;
	margin-top: 10px;
}

.homeTuTxt {
	width: 16px;
	font-size: 18px;
	font-weight: 400;
	word-wrap: break-word;
	word-break: normal;
	line-height: 40px;
	color: rgba(0, 65, 135, 1);
}

.bg1 .el-col {
	height: 100%;
}

.baseHeader {
	margin: 0;
	font-size: 18px;
	font-weight: 500;
	color: rgba(46, 48, 51, 1);
}

.baseInfo {
	display: flex;
	width: 100%;
	/* height: 64vh; */
	padding: 0 2.1vw;
	/* background: rgba(0, 123, 255, 0.1); */
	border-radius: 10px;
	align-items: center;
	margin-top: 1.3vh;
}

.baseInfozd {
	height: 34.3vh;
}

.baseInfoContent {
	width: 100%;
	height: 100%;
	/* padding-left: 1.9vw; */
}

.baseInfoContent>>>.el-row {
	display: flex;
	/* justify-content: space-between; */
}

.baseInfoContent>>>.el-input__inner {
	height: 100%;
	text-align: center;
}

.baseInfoContent>>>.el-form--inline .el-form-item__content,
.el-form--inline .el-form-item {
	vertical-align: middle !important;
}

.baseInfoContent>>>.el-form-item {
	margin-bottom: 0;
}

.baseInfoContent>>>.el-form {
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: space-evenly;
}

.baseInfo1 {
	width: 50%;
	display: flex;
	justify-content: flex-start;
}

.baseInfo1>>>.el-form-item__label {
	/* width: 11vw; */
	width: 150px;
	font-size: 14px;
	font-weight: 400;
	color: rgba(46, 48, 51, 1);
}

.company {
	width: 2.5vw;
	height: 2.7vh;
	line-height: 2.7vh;
	margin-top: 0.8vh;
	font-size: 14px;
}

.baseInfo2 {
	padding-left: 11vw;
}

.baseInfo2 div {
	width: 7.8vw;
	display: flex;
	justify-content: center;
}

.baseInfoBtn>>>.el-button--primary:focus,
.baseInfoBtn>>>.el-button--primary:hover {
	border-radius: 10px;
	background: rgba(25, 77, 138, 1) !important;
}

.baseInfoBtn>>>.el-button--primary {
	border-radius: 10px;
	background: rgba(25, 77, 138, 1) !important;
	font-size: 16px;
	font-weight: 400;
	color: rgba(255, 255, 255, 1);
}

.baseInfoBtnAll {
	width: 95%;
	justify-content: flex-end;
}

.danwei {
	font-size: 14px;
	font-weight: 400;
	color: rgba(46, 48, 51, 1);
}

.baseInfoBtnRight {
	position: absolute;
	right: 1.8vw;
	top: 2vh;
	height: 96%;
	width: 7.8vw;
}

.baseInfoBtnRight .baseInfoBtn {
	display: flex;
	flex-direction: column;
	height: 100%;
	justify-content: space-evenly;
}

.baseInfoBtnRight>>>.baseInfoBtn1,
.PEDCBtn>>>.baseInfoBtn1,
.PEDCInfo>>>.baseInfoBtn1 {
	background: rgba(42, 130, 228, 1) !important;
	border-color: rgba(42, 130, 228, 1) !important;
}

.baseInfoBtnRight>>>.baseInfoBtn1:focus,
.baseInfoBtnRight>>>.baseInfoBtn1:hover,
.PEDCBtn>>>.baseInfoBtn1:focus,
.PEDCBtn>>>.baseInfoBtn1:hover,
.PEDCInfo>>>.baseInfoBtn1:focus,
.PEDCInfo>>>.baseInfoBtn1:hover {
	background: rgba(42, 130, 228, 1) !important;
	border-color: rgba(42, 130, 228, 1) !important;
}

.baseInfoBtnRight>>>.baseInfoBtn2,
.PEDCBtn>>>.baseInfoBtn2,
.PEDCInfo>>>.baseInfoBtn2 {
	background: rgba(255, 87, 51, 1) !important;
	border-color: rgba(255, 87, 51, 1) !important;
}

.baseInfoBtnRight>>>.baseInfoBtn2:focus,
.baseInfoBtnRight>>>.baseInfoBtn2:hover,
.PEDCBtn>>>.baseInfoBtn2:focus,
.PEDCBtn>>>.baseInfoBtn2:hover,
.PEDCInfo>>>.baseInfoBtn2:focus,
.PEDCInfo>>>.baseInfoBtn2:hover {
	background: rgba(255, 87, 51, 1) !important;
	border-color: rgba(255, 87, 51, 1) !important;
}

.baseInfoBtnRight>>>.baseInfoBtn3 {
	background: rgba(67, 207, 124, 1) !important;
	border-color: rgba(67, 207, 124, 1) !important;
}

.baseInfoBtnRight>>>.baseInfoBtn3:focus,
.baseInfoBtnRight>>>.baseInfoBtn3:hover {
	background: rgba(67, 207, 124, 1) !important;
	border-color: rgba(67, 207, 124, 1) !important;
}

.baseInfoBtnRight>>>.baseInfoBtn4 {
	background: rgba(56, 56, 56, 1) !important;
	border-color: rgba(56, 56, 56, 1) !important;
}

.baseInfoBtnRight>>>.baseInfoBtn4:focus,
.baseInfoBtnRight>>>.baseInfoBtn4:hover {
	background: rgba(56, 56, 56, 1) !important;
	border-color: rgba(56, 56, 56, 1) !important;
}

.baseInfoBtnRight>>>.el-button {
	padding: 10px 12px;
}

.bg2 {
	background-color: #fff;
	border-radius: 10px;
	padding: 2.1vh 1.5vw;
	margin-top: 10px;
	height: 38.1vh;
}

.bg3 {
	height: auto !important;
}

.bg4 {
	height: 5vh;
	padding: 0;
	line-height: 5vh;
	padding: 0 1.5vw;
}

.bg3>>>.el-row {
	height: 100%;
}

.PEDCInfo {
	padding: 2vh 2.1vw 0;
	height: calc(100% - 23px);
	display: flex;
	align-items: center;
}

.PEDCBtn {
	display: flex;
}

.baseInfoEcharts {
	width: 100%;
	height: calc(100% - 23px);
}

.doorNuTxt>>>.el-input {
	height: 100%;
	line-height: 35px;
}

.doorNu1 {
	justify-content: flex-start;
}

.baseInfoBtn>>>.btn1 {
	font-size: 14px;
	font-weight: 400;
	border-radius: 5px;
	color: rgba(255, 255, 255, 1);
	background: rgba(255, 195, 0, 1) !important;
	border-color: rgba(255, 195, 0, 1) !important;
}

.baseInfoBtn>>>.btn1:focus,
.baseInfoBtn>>>.btn1:hover {
	background: rgba(255, 195, 0, 0.8) !important;
	border-color: rgba(255, 195, 0, 1) !important;
	border-radius: 5px !important;
}

.baseInfoBtn>>>.btn2 {
	font-size: 14px;
	font-weight: 400;
	border-radius: 5px;
	color: rgba(255, 255, 255, 1);
	background: rgba(67, 207, 124, 1) !important;
	border-color: rgba(67, 207, 124, 1) !important;
}

.baseInfoBtn>>>.btn2:focus,
.baseInfoBtn>>>.btn2:hover {
	background: rgba(67, 207, 124, 1) !important;
	border-color: rgba(67, 207, 124, 1) !important;
	border-radius: 5px !important;
}

.baseInfoBtn>>>.btn3 {
	font-size: 14px;
	font-weight: 400;
	border-radius: 5px;
	color: rgba(255, 255, 255, 1);
	background: rgba(255, 141, 26, 1) !important;
	border-color: rgba(255, 141, 26, 1) !important;
}

.baseInfoBtn>>>.btn3:focus,
.baseInfoBtn>>>.btn3:hover {
	background: rgba(255, 141, 26, 1) !important;
	border-color: rgba(255, 141, 26, 1) !important;
	border-radius: 5px !important;
}

.baseInfoBtn>>>.btn4,
.baseInfoBtn>>>.btn5 {
	font-size: 14px;
	font-weight: 400;
	border-radius: 5px;
	color: rgba(255, 255, 255, 1);
	background: rgba(66, 177, 255, 1) !important;
	border-color: rgba(66, 177, 255, 1) !important;
}

.baseInfoBtn>>>.btn4:focus,
.baseInfoBtn>>>.btn4:hover,
.baseInfoBtn>>>.btn5:focus,
.baseInfoBtn>>>.btn5:hover {
	background: rgba(66, 177, 255, 0.8) !important;
	border-color: rgba(66, 177, 255, 1) !important;
	border-radius: 5px !important;
}

.baseInfoBtn>>>.btn6,
.baseInfoBtn>>>.btn8 {
	font-size: 14px;
	font-weight: 400;
	border-radius: 5px;
	color: rgba(255, 255, 255, 1);
	background: rgba(67, 207, 124, 1) !important;
	border-color: rgba(67, 207, 124, 1) !important;
}

.baseInfoBtn>>>.btn6:focus,
.baseInfoBtn>>>.btn6:hover,
.baseInfoBtn>>>.btn8:focus,
.baseInfoBtn>>>.btn8:hover {
	border-radius: 5px !important;
	background: rgba(67, 207, 124, 0.8) !important;
	border-color: rgba(67, 207, 124, 1) !important;
}

.baseInfoBtn>>>.btn7 {
	font-size: 14px;
	font-weight: 400;
	border-radius: 5px;
	color: rgba(255, 255, 255, 1);
	background: rgba(255, 141, 26, 1) !important;
	border-color: rgba(255, 141, 26, 1) !important;
}

.baseInfoBtn>>>.btn7:focus,
.baseInfoBtn>>>.btn7:hover {
	border-radius: 5px !important;
	background: rgba(255, 141, 26, 0.8) !important;
	border-color: rgba(255, 141, 26, 1) !important;
}

.baseS {
	margin-left: 2vw;
}

.PEDCInfo>>>.el-form-item__label {
	text-align: left;
}

.baseInfo>>>.el-form-item--default {
	margin-bottom: 0px !important;
}

.progress-bar {
	width: 100%;
	height: 30px;
	overflow: hidden;
	box-sizing: border-box;
	border-radius: 24px;
	background-color: rgba(180, 160, 120, 0.2);
	position: relative;
}

.progress-bg {
	width: 0;
	height: 100%;
	overflow: hidden;
	box-sizing: border-box;
	background: rgba(67, 207, 124, 1);
	border-radius: 24px;
	/* animation: panoramic 2s linear infinite;
	  background-size: 32px 100%; */
}

/* @keyframes panoramic{
	  to {
	    width: 100%;
	  }
	} */
.baseTxt {
	text-align: left;
	font-size: 16px;
	display: flex;
	align-items: center;
}

.text-lf {
	text-align: left
}

.dcu-table {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}

.width-50 {
	width: 50%;
}

.mar-right-10 {
	margin-right: 10px;
}

.input-width {
	width: 7.8vw;
	height: 3.5vh;
}
</style>
